package util;

import entity.News;

/*
 * Set Category, Sub category by code from dantri.com.vn
 * add to Exits Category or create new.
 * 
 * */

public class DantriCategoryHelper {
	public static News getCategory(News n, String code, String subCode) {
		if (code.equalsIgnoreCase("C728")) {
			n.setCategory("su-kien");
			n.setSubCategory("tin-tuc-chung");
			return n;
		}
		if (code.equalsIgnoreCase("C20")) {
			n.setCategory("xa-hoi");
			if (subCode.equalsIgnoreCase("S696")) {
				n.setSubCategory("chinh-tri");
			}
			if (subCode.equalsIgnoreCase("S134")) {
				n.setSubCategory("phong-su");
			}
			if (subCode.equalsIgnoreCase("S255")) {
				n.setCategory("khoa-hoc");
				n.setSubCategory("moi-truong");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("C258")) {
			n.setCategory("xa-hoi");
			n.setSubCategory("tin-tuc-chung");
			return n;
		}
		if (code.equalsIgnoreCase("C36")) {
			n.setCategory("the-gioi");
			if (subCode.equalsIgnoreCase("S140")) {
				n.setSubCategory("chinh-tri");
			}
			if (subCode.equalsIgnoreCase("s138")) {
				n.setSubCategory("chinh-tri");
			}
			if (subCode.equalsIgnoreCase("s171")) {
				n.setSubCategory("chinh-tri");
			}
			if (subCode.equalsIgnoreCase("s172")) {
				n.setSubCategory("chinh-tri");
			}
			if (subCode.equalsIgnoreCase("s251")) {
				n.setSubCategory("nguoi-viet-5-chau");
			}
			if (subCode.equalsIgnoreCase("s729")) {
				n.setSubCategory("xuan-que-huong");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("C26")) {
			n.setCategory("the-thao");
			if (subCode.equalsIgnoreCase("s400")) {
				n.setSubCategory("bong-da");
			}
			if (subCode.equalsIgnoreCase("s404")) {
				n.setSubCategory("bong-da");
			}
			if (subCode.equalsIgnoreCase("s405")) {
				n.setSubCategory("bong-da");
			}
			if (subCode.equalsIgnoreCase("s406")) {
				n.setSubCategory("bong-da");
			}
			if (subCode.equalsIgnoreCase("s407")) {
				n.setSubCategory("bong-da");
			}
			if (subCode.equalsIgnoreCase("s408")) {
				n.setSubCategory("bong-da");
			}
			if (subCode.equalsIgnoreCase("s410")) {
				n.setSubCategory("tin-tuc-chung");
			}
			if (subCode.equalsIgnoreCase("s411")) {
				n.setSubCategory("tin-tuc-chung");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("C25")) {
			n.setCategory("xa-hoi");
			if (subCode.equalsIgnoreCase("s201")) {
				n.setSubCategory("tuyen-sinh");
			}
			if (subCode.equalsIgnoreCase("s146")) {
				n.setSubCategory("co-hoi-du-hoc");
			}
			if (subCode.equalsIgnoreCase("s181")) {
				n.setSubCategory("giao-duc");
			}
			if (subCode.equalsIgnoreCase("s182")) {
				n.setSubCategory("giao-duc");
			}
			if (subCode.equalsIgnoreCase("s177")) {
				n.setSubCategory("giao-duc");
			}
			if (subCode.equalsIgnoreCase("s719")) {
				n.setSubCategory("tin-tuc-chung");
			}
			if (subCode.equalsIgnoreCase("s177")) {
				n.setSubCategory("nhan-tai-dat-viet");
			}
			if (subCode.equalsIgnoreCase("s704")) {
				n.setSubCategory("tuyen-sinh");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("c167")) {
			n.setCategory("xa-hoi");
			if (subCode.equalsIgnoreCase("s674")) {
				n.setSubCategory("tam-long-nhan-ai");
			}
			if (subCode.equalsIgnoreCase("s675")) {
				n.setSubCategory("ketchuyen");
			}
			if (subCode.equalsIgnoreCase("s718")) {
				n.setSubCategory("hoancanh");
			}
			n.setSubCategory("tam-long-nhan-ai");
			return n;
		}
		if (code.equalsIgnoreCase("c76")) {
			n.setCategory("kinh-doanh");
			if (subCode.equalsIgnoreCase("s234")) {
				n.setSubCategory("chung-khoan");
			}
			if (subCode.equalsIgnoreCase("s83")) {
				n.setSubCategory("thi-truong");
			}
			if (subCode.equalsIgnoreCase("s82")) {
				n.setSubCategory("doanh-nghiep-viet");
			}
			if (subCode.equalsIgnoreCase("s231")) {
				n.setSubCategory("quoc-te");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("c23")) {
			n.setCategory("van-hoa");
			if (subCode.equalsIgnoreCase("s730")) {
				n.setSubCategory("tin-tuc-chung");
			}
			if (subCode.equalsIgnoreCase("s154")) {
				n.setSubCategory("am-nhac");
			}
			if (subCode.equalsIgnoreCase("s155")) {
				n.setSubCategory("san-khau-dien-anh");

			}
			if (subCode.equalsIgnoreCase("s156")) {
				n.setSubCategory("thoi-trang");
			}
			if (subCode.equalsIgnoreCase("s157")) {
				n.setSubCategory("an-choi");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("c170")) {
			n.setCategory("phap-luat");
			n.setSubCategory("tin-tuc-chung");
			return n;
		}
		if (code.equalsIgnoreCase("c135")) {
			n.setCategory("xa-hoi");
			n.setSubCategory("nhip-dieu-tre");
			return n;
		}
		if (code.equalsIgnoreCase("c168")) {
			n.setCategory("xa-hoi");
			n.setSubCategory("nhip-dieu-tre");
			return n;
		}
		if (code.equalsIgnoreCase("c130")) {
			n.setCategory("doi-song");
			if (subCode.equalsIgnoreCase("s158")) {
				n.setSubCategory("tinh-yeu");
			}
			if (subCode.equalsIgnoreCase("s161")) {
				n.setSubCategory("gia-dinh");
			}
			if (subCode.equalsIgnoreCase("s227")) {
				n.setSubCategory("blog");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("c7")) {
			n.setCategory("suc-khoe");
			if (subCode.equalsIgnoreCase("s160")) {
				n.setSubCategory("gioi-tinh");
			}
			if (subCode.equalsIgnoreCase("s162")) {
				n.setSubCategory("tu-van");
			}
			if (subCode.equalsIgnoreCase("s223")) {
				n.setSubCategory("lam-dep");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("c119")) {
			n.setCategory("vi-tinh");
			if (subCode.equalsIgnoreCase("s147")) {
				n.setSubCategory("tin-tuc-chung");
			}
			if (subCode.equalsIgnoreCase("s148")) {
				n.setSubCategory("san-pham-moi");
			}
			if (subCode.equalsIgnoreCase("s243")) {
				n.setSubCategory("thu-thuat");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("c111")) {
			n.setCategory("oto-xe-may");
			if (subCode.equalsIgnoreCase("s207")) {
				n.setSubCategory("thi-truong");
			}
			if (subCode.equalsIgnoreCase("s228")) {
				n.setSubCategory("nguoi-va-xe");
			}
			if (subCode.equalsIgnoreCase("s208")) {
				n.setSubCategory("van-hoa-xe");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		}
		if (code.equalsIgnoreCase("c132")) {
			n.setCategory("xa-hoi");
			n.setSubCategory("chuyen-la");
			return n;
		}
		if (code.equalsIgnoreCase("c202")) {
			n.setCategory("ban-doc-viet");
			if (subCode.equalsIgnoreCase("s666")) {
				n.setSubCategory("tu-van-phap-luat");
			}
			if (subCode.equalsIgnoreCase("s662")) {
				n.setSubCategory("hoi-am");
			}
			if (subCode.equalsIgnoreCase("s669")) {
				n.setSubCategory("goc-anh");
			} else {
				n.setSubCategory("tin-tuc-chung");
			}
			return n;
		} else {
			n.setCategory("xa-hoi");
			n.setSubCategory("tin-tuc-chung");
			return n;
		}

	}

}
